Public Class Records
    Public bmp3 As Bitmap
    Public op As Integer = 1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

    Private Sub Records_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim bmp As New Bitmap(Me.Width, Me.Height)
        Dim graph As Graphics = Graphics.FromImage(bmp)
        Dim b1 As New Drawing2D.LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height), Color.Green, Color.Blue, Drawing2D.LinearGradientMode.BackwardDiagonal)
        Dim a As New Drawing2D.ColorBlend
        a.Colors = New Color() {Color.Yellow, Color.Green, Color.Navy, Color.MintCream, Color.Salmon, Color.SteelBlue}
        a.Positions = New Single() {0.0, 0.3, 0.4, 0.6, 0.8, 1.0}
        b1.InterpolationColors = a
        graph.FillRectangle(b1, New Rectangle(0, 0, Me.Width, Me.Height))

        a.Colors = New Color() {Color.Yellow, Color.Gold, Color.PaleGoldenrod, Color.Transparent}
        a.Positions = New Single() {0.0, 0.4, 0.75, 1.0}
        b1.InterpolationColors = a
        Panel1.BackColor = Color.Yellow
        'Dim bmp1 As New Bitmap(Me.Width - 50, Me.Height - 50)
        LoadRecords()
        Dim bmp2 As New Bitmap(Panel1.Width, Panel1.Height)
        Panel1.DrawToBitmap(bmp2, New Rectangle(0, 0, Panel1.Width, Panel1.Height))
        'EnableAll(False)
        bmp2 = ReflectionLib.CreateFade(bmp2, 25)
        bmp2 = ReflectionLib.ApplyReflection(bmp2, 75, 0, 200, 0)
        Panel1.Visible = False

        'Dim graph1 As Graphics = Graphics.FromImage(bmp)
        graph.DrawImage(bmp2, Panel1.Location)
        'graph1.FillRectangle(b1, New Rectangle(0, 0, Me.Width - 50, Me.Height - 50))
        'graph1.DrawString(Label1.Text, Label1.Font, Brushes.DarkGoldenrod, Label1.Location.X, Label1.Location.Y)
        bmp3 = bmp2
        Button1.Visible = False
        Button2.Visible = False
        Dim bmp4 As New Bitmap(Button1.Width + 30, Button1.Height + 30)
        Dim bmp5 As New Bitmap(Button2.Width + 30, Button2.Height + 30)
        Dim graph4 As Graphics = Graphics.FromImage(bmp4)
        Dim graph5 As Graphics = Graphics.FromImage(bmp5)
        'graph4.FillRectangle(Brushes.Yellow,new Rectangle(button1.Location.X - 50,button1.Location.Y - 50,bmp4.Width,bmp4.Height))
        graph4.FillRectangle(Brushes.Green, New Rectangle(0, 0, bmp4.Width, bmp4.Height))
        graph5.FillRectangle(Brushes.Red, New Rectangle(0, 0, bmp5.Width, bmp5.Height))
        bmp4 = ReflectionLib.CreateFade(bmp4, 25)
        bmp5 = ReflectionLib.CreateFade(bmp5, 25)
        graph.DrawImage(bmp4, New Point(Button1.Location.X - 15, Button1.Location.Y - 15))
        graph.DrawImage(bmp5, New Point(Button2.Location.X - 15, Button2.Location.Y - 15))
        Button1.Visible = True
        Button2.Visible = True
        Me.BackgroundImage = bmp
        'For op = 1 To 255 Step 5
        '    bmp3 = IMGS.EditOpacity(bmp1, op)
        '    graph.DrawImage(ReflectionLib.CreateFade(bmp3, 25), Panel1.Location)
        '    LoadRecords()
        'Next
        'Timer1.Enabled = True
    End Sub
    Public Sub LoadRecords()

        lbl1.Text = My.Settings.Rec1
        lbl2.Text = My.Settings.Rec2
        lbl3.Text = My.Settings.Rec3
        lbl4.Text = My.Settings.Rec4
        lbl5.Text = My.Settings.Rec5
        per1.Text = My.Settings.Record1 & "%"
        per2.Text = My.Settings.Record2 & "%"
        per3.Text = My.Settings.Record3 & "%"
        per4.Text = My.Settings.Record4 & "%"
        per5.Text = My.Settings.Record5 & "%"
        lblGames.Text = "Total Games Played: " & My.Settings.GameCount
        lblGames.Location = New Point((Panel1.Width / 2) - (lblGames.Width / 2), lblGames.Location.Y)



    End Sub
    Public Sub LoadRecs()
        LoadRecords()
        Dim graph As Graphics = Graphics.FromImage(Me.BackgroundImage)
        Button1.Visible = False
        Button2.Visible = False
        Dim bmp4 As New Bitmap(Button1.Width + 30, Button1.Height + 30)
        Dim bmp5 As New Bitmap(Button2.Width + 30, Button2.Height + 30)
        Dim graph4 As Graphics = Graphics.FromImage(bmp4)
        Dim graph5 As Graphics = Graphics.FromImage(bmp5)
        'graph4.FillRectangle(Brushes.Yellow,new Rectangle(button1.Location.X - 50,button1.Location.Y - 50,bmp4.Width,bmp4.Height))
        graph4.FillRectangle(Brushes.Green, New Rectangle(0, 0, bmp4.Width, bmp4.Height))
        graph5.FillRectangle(Brushes.Red, New Rectangle(0, 0, bmp5.Width, bmp5.Height))
        bmp4 = ReflectionLib.CreateFade(bmp4, 25)
        bmp5 = ReflectionLib.CreateFade(bmp5, 25)
        graph.DrawImage(bmp4, New Point(Button1.Location.X - 15, Button1.Location.Y - 15))
        graph.DrawImage(bmp5, New Point(Button2.Location.X - 15, Button2.Location.Y - 15))
        Button1.Visible = True
        Button2.Visible = True
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim mes As Microsoft.VisualBasic.MsgBoxStyle
        'mes = MsgBoxStyle.DefaultButton2
        Dim res As Microsoft.VisualBasic.MsgBoxResult
        mes = MsgBoxStyle.YesNo
        res = MsgBox("Are you sure you want to delete ALL high score records?" & (Chr(13)) & "This action CANNOT be undone!!!", mes, "Continue?")
        If res = MsgBoxResult.Yes Then
            GoTo 10
        Else : Exit Sub
        End If
10:
        a = My.Settings.MaxLen
        b = My.Settings.MinLen
        c = My.Settings.Dictionary

        My.Settings.Reset()

        My.Settings.MaxLen = a
        My.Settings.MinLen = b
        My.Settings.Dictionary = c

        Me.LoadRecords()
        Start()
    End Sub
    Public Sub EnableAll(ByVal enable As Boolean)
        Label1.Visible = enable
        lbl1.Visible = enable
        per1.Visible = enable
        Label2.Visible = enable
        lbl2.Visible = enable
        per2.Visible = enable
        Label3.Visible = enable
        lbl3.Visible = enable
        per3.Visible = enable
        Label4.Visible = enable
        lbl4.Visible = enable
        per4.Visible = enable
        Label5.Visible = enable
        lbl5.Visible = enable
        per5.Visible = enable

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim graph As Graphics = Graphics.FromImage(Me.BackgroundImage)
        bmp1 = IMGS.EditOpacity(bmp3, op)
        op = op + 5

        graph.DrawImage(ReflectionLib.CreateFade(bmp3, 25), New PointF(50, 50))
        LoadRecords()

    End Sub
    Public Sub Start()
        Dim bmp As New Bitmap(Me.Width, Me.Height)
        Dim graph As Graphics = Graphics.FromImage(bmp)
        Dim b1 As New Drawing2D.LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height), Color.Green, Color.Blue, Drawing2D.LinearGradientMode.BackwardDiagonal)
        Dim a As New Drawing2D.ColorBlend
        a.Colors = New Color() {Color.Yellow, Color.Green, Color.Navy, Color.MintCream, Color.Salmon, Color.SteelBlue}
        a.Positions = New Single() {0.0, 0.3, 0.4, 0.6, 0.8, 1.0}
        b1.InterpolationColors = a
        graph.FillRectangle(b1, New Rectangle(0, 0, Me.Width, Me.Height))

        a.Colors = New Color() {Color.Yellow, Color.Gold, Color.PaleGoldenrod, Color.Transparent}
        a.Positions = New Single() {0.0, 0.4, 0.75, 1.0}
        b1.InterpolationColors = a
        Panel1.BackColor = Color.Yellow
        'Dim bmp1 As New Bitmap(Me.Width - 50, Me.Height - 50)
        LoadRecords()
        Dim bmp2 As New Bitmap(Panel1.Width, Panel1.Height)
        Panel1.DrawToBitmap(bmp2, New Rectangle(0, 0, Panel1.Width, Panel1.Height))
        'EnableAll(False)
        bmp2 = ReflectionLib.CreateFade(bmp2, 25)
        bmp2 = ReflectionLib.ApplyReflection(bmp2, 75, 0, 200, 0)
        Panel1.Visible = False

        'Dim graph1 As Graphics = Graphics.FromImage(bmp)
        graph.DrawImage(bmp2, Panel1.Location)
        'graph1.FillRectangle(b1, New Rectangle(0, 0, Me.Width - 50, Me.Height - 50))
        'graph1.DrawString(Label1.Text, Label1.Font, Brushes.DarkGoldenrod, Label1.Location.X, Label1.Location.Y)
        bmp3 = bmp2
        Button1.Visible = False
        Button2.Visible = False
        Dim bmp4 As New Bitmap(Button1.Width + 30, Button1.Height + 30)
        Dim bmp5 As New Bitmap(Button2.Width + 30, Button2.Height + 30)
        Dim graph4 As Graphics = Graphics.FromImage(bmp4)
        Dim graph5 As Graphics = Graphics.FromImage(bmp5)
        'graph4.FillRectangle(Brushes.Yellow,new Rectangle(button1.Location.X - 50,button1.Location.Y - 50,bmp4.Width,bmp4.Height))
        graph4.FillRectangle(Brushes.Green, New Rectangle(0, 0, bmp4.Width, bmp4.Height))
        graph5.FillRectangle(Brushes.Red, New Rectangle(0, 0, bmp5.Width, bmp5.Height))
        bmp4 = ReflectionLib.CreateFade(bmp4, 25)
        bmp5 = ReflectionLib.CreateFade(bmp5, 25)
        graph.DrawImage(bmp4, New Point(Button1.Location.X - 15, Button1.Location.Y - 15))
        graph.DrawImage(bmp5, New Point(Button2.Location.X - 15, Button2.Location.Y - 15))
        Button1.Visible = True
        Button2.Visible = True
        Me.BackgroundImage = bmp
        'For op = 1 To 255 Step 5
        '    bmp3 = IMGS.EditOpacity(bmp1, op)
        '    graph.DrawImage(ReflectionLib.CreateFade(bmp3, 25), Panel1.Location)
        '    LoadRecords()
        'Next
        'Timer1.Enabled = True
    End Sub
End Class